package org.springblade.modules.admin.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springblade.core.tenant.annotation.TenantIgnore;
import org.springblade.core.tool.api.R;
import org.springblade.modules.admin.entity.MaintainTemplateLocationType;
import org.springblade.modules.admin.service.MaintainTemplateLocationTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Date 11:29 2022/3/14
 * @Description {
 *    任务模板分类接口
 * }
 * @Author lsay
 **/
@RestController
@RequestMapping("/maintain/template/location/type")
public class MaintainTemplateLocationTypeController {

	@Autowired
	private MaintainTemplateLocationTypeService templateLocationTypeService;

	/**
	 * 查询数据列表
	 * @param parentId
	 * @return
	 */
	@TenantIgnore
	@GetMapping("/list")
	public R<List<MaintainTemplateLocationType>> list(Long parentId,String planType,Integer tier){
		return R.data(templateLocationTypeService.list(Wrappers.<MaintainTemplateLocationType>lambdaQuery()
			.eq(MaintainTemplateLocationType::getParentId,parentId).eq(MaintainTemplateLocationType::getPlanType,planType).eq(MaintainTemplateLocationType::getTier,tier)));
	}



}
